package com.example.demo;


import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/calc")
@RestController
public class calcController {

    @PostMapping("/sum")
    public String sum(Integer s1 ,Integer s2) {
        if(s1 == null || s2 == null) {
            return "输入不合法！";
        }
        Integer s3 = s1 + s2;
        return "计算结果：" + s3;
    }
}
